﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Themes/Main.master" AutoEventWireup="true"
    CodeBehind="ChildrenEdit.aspx.cs" Inherits="TrainingsApp.IPADApp.Master.ChildrenEdit" %>

<%@ Register Assembly="DevExpress.Web.ASPxEditors.v11.1" Namespace="DevExpress.Web.ASPxEditors"
    TagPrefix="dx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        body
        {
            margin: 0px;
            padding: 0px;
            font-size: 12px;
            font-family: "微软雅黑";
        }
        
        .editform
        {
            border: 1px solid black;
            padding: 5px;
            margin-top: 5px;
        }
        
        .editform .header
        {
            height: 30px;
            font-size: 16px;
            line-height: 30px;
            font-weight: 700;
            border-bottom: 1px solid #000099;
        }
        .editform .title
        {
            height: 30px;
            padding-top: 3px;
            padding-bottom: 3px;
            width: 15%;
            font-weight: 600;
        }
        
        .editform .input
        {
            height: 30px;
            width: 35%;
            font-weight: 600;
            padding-top: 3px;
            padding-bottom: 3px;
        }
        
        .editform .saves, .backs
        {
            padding-top: 10px;
            padding-bottom: 10px;
            border-top: 3px solid black;
            width: 50%;
            padding-left: 5px;
            padding-right: 5px;
        }
        
        .editform .operat
        {
            background-color: #CCC;
            border-top: 3px solid black;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript">
        function OnSchoolChange(s, e) {
            cbxClass.PerformCallback(cbxSchool.GetValue().toString());
        }

        function OnCourseChange(s, e) {
            cbxMaterials.PerformCallback(cbxCourse.GetValue().toString());
        }
    </script>
    <table cellpadding="0" class="editform" width="100%" cellspacing="0" border="0">
        <tr class="header">
            <td class="header" colspan="4">
                基本信息
            </td>
        </tr>
        <tr>
            <td class="title">
                用户名 :
            </td>
            <td class="input">
                <asp:Literal ID="ltUserName" runat="server"></asp:Literal>
                <dx:ASPxTextBox ID="txtUserName" Width="220" runat="server">
                    <ValidationSettings Display="Dynamic" ErrorDisplayMode="ImageWithText" ErrorTextPosition="Bottom">
                        <RequiredField IsRequired="true" ErrorText="请输入姓名" />
                    </ValidationSettings>
                </dx:ASPxTextBox>
            </td>
            <td colspan="2" align="left" rowspan="3">
                <img src="" width="100" height="100" />
            </td>
        </tr>
        <tr>
            <td class="title">
                密码 :
            </td>
            <td class="input">
                <dx:ASPxButton ID="btnResetPwd" runat="server" Visible="false" Text="重置密码">
                    <ClientSideEvents Click="function(s,e){e.processOnServer=false;s.SetVisible(false);txtPwd.SetVisible(true);}" />
                </dx:ASPxButton>
                <dx:ASPxTextBox ID="txtPassword" ClientInstanceName="txtPwd" Password="true" Width="220"
                    runat="server">
                    <ValidationSettings Display="Dynamic" ErrorDisplayMode="ImageWithText" ErrorTextPosition="Bottom">
                        <RequiredField IsRequired="true" ErrorText="请输入密码" />
                    </ValidationSettings>
                </dx:ASPxTextBox>
            </td>
        </tr>
        <tr>
            <td class="title">
                姓名 :
            </td>
            <td class="input">
                <dx:ASPxTextBox ID="txtName" Width="220" runat="server">
                    <ValidationSettings Display="Dynamic" ErrorDisplayMode="ImageWithText" ErrorTextPosition="Bottom">
                        <RequiredField IsRequired="true" ErrorText="请输入姓名" />
                    </ValidationSettings>
                </dx:ASPxTextBox>
            </td>
        </tr>
        <tr>
            <td class="title">
                性别 :
            </td>
            <td class="input">
                <asp:RadioButton ID="rbtnMale" runat="server" Text="男" GroupName="Gender" />&nbsp;&nbsp;
                <asp:RadioButton ID="rbtnFmale" runat="server" Text="女" GroupName="Gender" />
            </td>
            <td class="title">
                出生日期 :
            </td>
            <td class="input">
                <dx:ASPxDateEdit ID="txtBirthDay" runat="server" Width="220">
                </dx:ASPxDateEdit>
            </td>
        </tr>
        <tr>
            <td class="title">
                身份证 :
            </td>
            <td class="input">
                <dx:ASPxTextBox ID="txtIdCard" MaxLength="18" Width="220" runat="server">
                </dx:ASPxTextBox>
            </td>
            <td class="title">
                手机 :
            </td>
            <td class="input">
                <dx:ASPxTextBox ID="txtMobile" MaxLength="18" Width="220" runat="server">
                </dx:ASPxTextBox>
            </td>
        </tr>
        <tr>
            <td class="title">
                邮箱 :
            </td>
            <td class="input">
                <dx:ASPxTextBox ID="txtMail" MaxLength="100" Width="220" runat="server">
                </dx:ASPxTextBox>
            </td>
            <td class="title">
                &nbsp;
            </td>
            <td class="input">
                &nbsp;
            </td>
        </tr>
    </table>
    <table cellpadding="0" class="editform" width="100%" cellspacing="0" border="0">
        <tr class="header">
            <td class="header" colspan="4">
                学生相关信息
            </td>
        </tr>
        <tr style="height: 30px;">
            <td class="title">
                学校 :
            </td>
            <td class="input">
                <script type="text/javascript">
                    function UpdateText() {

                        var selectedItems = cbxSchoolList.GetSelectedItems();
                        if (selectedItems.length <= 0) { return false; }
                        var selectItem = selectedItems[0];
                        cbxSchool.SetText(selectItem.text);
                        cbxSchool.HideDropDown();

                        jQuery("#hidSchoolIdx").val(selectItem.value);
                        cbxClass.PerformCallback(selectItem.value);
                    }

                </script>
                <asp:HiddenField ID="hidSchoolIdx" runat="server" ClientIDMode="Static" />
                <dx:ASPxDropDownEdit ID="cbxSchool" DropDownButton-Text="搜索" Font-Names="微软雅黑" Font-Size="12px"
                    Height="30" ClientInstanceName="cbxSchool" Width="220" runat="server">
                    <ClientSideEvents DropDown="function(s,e){cbxSchoolList.PerformCallback(cbxSchool.GetText());}" />
                    <DropDownWindowTemplate>
                        <dx:ASPxListBox Width="100%" ID="cbxSchoolList" ClientInstanceName="cbxSchoolList"
                            SelectionMode="Single" TextField="SchoolName" ValueField="Idx" runat="server"
                            OnCallback="cbxSchoolList_Callback">
                            <Border BorderStyle="None" />
                            <BorderBottom BorderStyle="Solid" BorderWidth="1px" BorderColor="#DCDCDC" />
                            <ClientSideEvents SelectedIndexChanged="function(s,e){UpdateText();}" />
                        </dx:ASPxListBox>
                    </DropDownWindowTemplate>
                    <ValidationSettings Display="Dynamic" ErrorDisplayMode="ImageWithText" ErrorTextPosition="Bottom">
                        <RequiredField IsRequired="true" ErrorText="请选择学校" />
                    </ValidationSettings>
                </dx:ASPxDropDownEdit>
            </td>
            <td class="title">
                班级 :
            </td>
            <td class="input">
                <dx:ASPxComboBox ID="cbxClass" ClientInstanceName="cbxClass" DropDownStyle="DropDownList"
                    Width="220" runat="server" OnCallback="cbxClass_Callback">
                    <ValidationSettings Display="Dynamic" ErrorDisplayMode="ImageWithText" ErrorTextPosition="Bottom">
                        <RequiredField IsRequired="true" ErrorText="请选择班级" />
                    </ValidationSettings>
                </dx:ASPxComboBox>
            </td>
        </tr>
        <tr>
            <td class="title">
                学员编号 :
            </td>
            <td class="input">
                <dx:ASPxTextBox ID="txtStuCode" MaxLength="100" Width="220" runat="server">
                </dx:ASPxTextBox>
            </td>
            <td class="title">
                &nbsp;
            </td>
            <td class="input">
                &nbsp;
            </td>
        </tr>
    </table>
    <hr style="margin-top: 2px; margin-bottom: 2px; height: 2px; width: 100%" />
    <table cellpadding="0" class="editform" width="100%" cellspacing="0" border="0">
        <tr class="header">
            <td class="header" colspan="4">
                家长基本信息
            </td>
        </tr>
        <tr>
            <td class="title">
                用户名 :
            </td>
            <td class="input">
                <dx:ASPxTextBox ID="txtParentUserName" Width="220" runat="server">
                    <ValidationSettings Display="Dynamic" ErrorDisplayMode="ImageWithText" ErrorTextPosition="Bottom">
                        <RequiredField IsRequired="true" ErrorText="请输入姓名" />
                    </ValidationSettings>
                </dx:ASPxTextBox>
            </td>
            <td colspan="2" align="left" rowspan="3">
                <img src="" width="100" height="100" />
            </td>
        </tr>
        <tr>
            <td class="title">
                密码 :
            </td>
            <td class="input">
                <dx:ASPxButton ID="btnParentReset" runat="server" Visible="false" Text="重置密码">
                    <ClientSideEvents Click="function(s,e){e.processOnServer=false;s.SetVisible(false);txtPwd.SetVisible(true);}" />
                </dx:ASPxButton>
                <dx:ASPxTextBox ID="txtParentPwd" ClientInstanceName="txtParentPwd" Password="true"
                    Width="220" runat="server">
                    <ValidationSettings Display="Dynamic" ErrorDisplayMode="ImageWithText" ErrorTextPosition="Bottom">
                        <RequiredField IsRequired="true" ErrorText="请输入密码" />
                    </ValidationSettings>
                </dx:ASPxTextBox>
            </td>
        </tr>
        <tr>
            <td class="title">
                姓名 :
            </td>
            <td class="input">
                <dx:ASPxTextBox ID="txtParentName" Width="220" runat="server">
                    <ValidationSettings Display="Dynamic" ErrorDisplayMode="ImageWithText" ErrorTextPosition="Bottom">
                        <RequiredField IsRequired="true" ErrorText="请输入姓名" />
                    </ValidationSettings>
                </dx:ASPxTextBox>
            </td>
        </tr>
        <tr>
            <td class="title">
                性别 :
            </td>
            <td class="input">
                <asp:RadioButton ID="rbtnParentMale" runat="server" Text="男" GroupName="ParentGender" />&nbsp;&nbsp;
                <asp:RadioButton ID="rbtnParentFeMale" runat="server" Text="女" GroupName="ParentGender" />
            </td>
            <td class="title">
                出生日期 :
            </td>
            <td class="input">
                <dx:ASPxDateEdit ID="txtParentBirth" runat="server" Width="220">
                </dx:ASPxDateEdit>
            </td>
        </tr>
        <tr>
            <td class="title">
                身份证 :
            </td>
            <td class="input">
                <dx:ASPxTextBox ID="txtParentIDCard" MaxLength="18" Width="220" runat="server">
                </dx:ASPxTextBox>
            </td>
            <td class="title">
                手机 :
            </td>
            <td class="input">
                <dx:ASPxTextBox ID="txtParentMobile" MaxLength="18" Width="220" runat="server">
                </dx:ASPxTextBox>
            </td>
        </tr>
        <tr>
            <td class="title">
                邮箱 :
            </td>
            <td class="input">
                <dx:ASPxTextBox ID="txtParentMail" MaxLength="100" Width="220" runat="server">
                </dx:ASPxTextBox>
            </td>
            <td class="title">
                关系
            </td>
            <td class="input">
                <dx:ASPxComboBox ID="cbxParentRef" Width="220" runat="server">
                    <Items>
                        <dx:ListEditItem Text="母亲" Value="0" />
                        <dx:ListEditItem Text="父亲" Value="0" />
                        <dx:ListEditItem Text="爷爷" Value="0" />
                        <dx:ListEditItem Text="奶奶" Value="0" />
                        <dx:ListEditItem Text="外公" Value="0" />
                        <dx:ListEditItem Text="外婆" Value="0" />
                        <dx:ListEditItem Text="舅舅" Value="0" />
                        <dx:ListEditItem Text="舅妈" Value="0" />
                        <dx:ListEditItem Text="叔叔" Value="0" />
                        <dx:ListEditItem Text="阿姨" Value="0" />
                    </Items>
                </dx:ASPxComboBox>
            </td>
        </tr>
        <tr>
            <td class="title">
                工作单位 :
            </td>
            <td class="input">
                <dx:ASPxTextBox ID="txtParentCompany" MaxLength="100" Width="220" runat="server">
                </dx:ASPxTextBox>
            </td>
            <td class="title">
                职位
            </td>
            <td class="input">
                <dx:ASPxTextBox ID="txtParentPosition" MaxLength="100" Width="220" runat="server">
                </dx:ASPxTextBox>
            </td>
        </tr>
        <tr class="operat">
            <td class="saves" align="right" colspan="2">
                <dx:ASPxButton ID="btnSave" runat="server" Width="100" Text="保存" OnClick="btnSave_Click">
                </dx:ASPxButton>
            </td>
            <td class="backs" align="left" colspan="2">
                <dx:ASPxButton ID="btnBack" runat="server" Width="100" Text="返回" OnClick="btnBack_Click">
                </dx:ASPxButton>
            </td>
        </tr>
    </table>
</asp:Content>
